# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python-plac
_pkgname=plac
pkgver=1.4.5
pkgrel=1
pkgdesc='Python package that can generate command line parameters from function signatures.'
arch=('any')
url='https://pypi.org/project/plac/'
license=('BSD')
depends=('python')
makedepends=('python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('dff318ad9f47ecc657990ebf7a6d08f19222bca079a766da0e0380d7d39daf97708e8210f76422c99877921e43becd9784d9003b6bdb1f13540d8722edcb14b1')

build() {
  cd "$_pkgname-$pkgver"

  python setup.py build
}

package() {
  cd "$_pkgname-$pkgver"

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build

  for s in "$pkgdir/usr/bin/"*;do
    arrS=(${s//./ })
    mv $s "${arrS[0]}"
  done
}

